import request from '@/utils/request'

export default {
  //分页获取商品列表
    getFlowerList(currentPage){
      return request({
        url:'/flower/list',
        method:'get',
        params:{
          currentPage
        }
      })
    },
  //搜索商品
  findFlower(keyword){
      return request({
        url:'/flower/find',
        method:'get',
        params:{
          keyword
        }
      })
  },
  //添加商品
  addFlower(flower){
      return request({
        url:'/flower/',
        method:'put',
        data:{
          flower
        }
      })
  },
  //上传图片
  handlePicture(data){
      return request({
        url:'/flower/addPic',
        method:'post',
        data:data
      })
  },
  //获取商品的图片
  showPicture(id){
      return request({
        url:'/flower/getPicList',
        methodL:'get',
        params:{
          id
        }
      })
  },
  deleteFlower(id){
      return request({
        url:'/flower/',
        method:'delete',
        params:{
          id
        }
      })
  },
  // 修改商品
  handleFlower(flower){
    return request({
        url:'/flower/',
        method:'post',
        data:flower
      })
  },
  // 删除图片
  deletePicuter(flowerPic){
      return request({
        url:'/flower/deletePic',
        method:'delete',
        params:flowerPic
      })
  }
}
